import 'package:flutter_test/flutter_test.dart';
import 'package:stripe_connection_plugin/stripe_connection_plugin.dart';
import 'package:stripe_connection_plugin/stripe_connection_plugin_platform_interface.dart';
import 'package:stripe_connection_plugin/stripe_connection_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockStripeConnectionPluginPlatform
    with MockPlatformInterfaceMixin
    implements StripeConnectionPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final StripeConnectionPluginPlatform initialPlatform = StripeConnectionPluginPlatform.instance;

  test('$MethodChannelStripeConnectionPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelStripeConnectionPlugin>());
  });

  test('getPlatformVersion', () async {
    StripeConnectionPlugin stripeConnectionPlugin = StripeConnectionPlugin();
    MockStripeConnectionPluginPlatform fakePlatform = MockStripeConnectionPluginPlatform();
    StripeConnectionPluginPlatform.instance = fakePlatform;

    expect(await stripeConnectionPlugin.getPlatformVersion(), '42');
  });
}
